#!/bin/bash
#此脚本使用在Android 各项处理上
#制作者：振云
#修改：luo2888

TIMES=0
result=$(adb reboot download 2>&1)
echo -e "\033[36mGo To Download Mode| 即将重启到 Download模式\033[0m"
status=`echo $result|awk -F : '{print $1}'`
while [[ "$status" == "error" ]]; do
	echo -e "\033[31m$result\033[0m"
	echo -e "\033[33m$TIMES: we will try in 3 seconds....\033[0m"
	sleep 2
	((TIMES++))
	result=$(adb reboot download 2>&1)
	status=`echo $result|awk -F : '{print $1}'`
done
echo -e "\033[32mDone!\033[0m"

